@extends('admin.app')

@section('breadcrumb')
    <div class="bg-light lter b-b wrapper-md">
        <ol class="breadcrumb bg-light lter m-n no-padder">
            <li><a href="{{ admin_action('HomeController@index') }}">主页</a></li>
            <li>业务管理</li>
            <li><a href="{{ admin_action('Business\OrganizationalUserManagementController@index') }}">机构用户管理</a></li>
            <li class="active">新增机构用户</li>
        </ol>
    </div>
@endsection

@section('content')
    <div class="panel panel-default">
        <div class="panel-heading font-bold">
            机构用户信息表单
        </div>
        <div class="panel-body">
            <form enctype="multipart/form-data" class="form-horizontal form-validation"
                  action="{{ admin_action('Business\OrganizationalUserManagementController@store') }}"
                  method="post">
                {{ csrf_field() }}
                <label>用户基本信息</label>
                <div class="line line-dashed b-b line-lg"></div>
                <div class="form-group">
                    <label class="col-lg-2 control-label">登陆用户名*</label>
                    <div class="col-lg-4">
                        <input type="text" class="form-control" name="username" value="{{ old('username') }}"
                               placeholder="请输入您的登陆用户名" data-rule-required="true" data-rule-maxLength="90"
                               data-rule-remote="{{ action('Utils\UtilsController@userNameExists') }}" data-msg-remote="这个用户名已经存在">
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-lg-2 control-label">登陆密码*</label>
                    <div class="col-lg-4">
                        <input type="text" class="form-control" name="password" value="{{ old('password')??'bbl123456' }}"
                               placeholder="请输入您的登陆密码" data-rule-required="true" data-rule-maxLength="90">
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-lg-2 control-label">机构角色*</label>
                    <div class="col-lg-4">
                    <select class="select2 form-control" name="roles[]" data-rule-required='true' multiple="multiple">
                        <option value="7">担保机构</option>
                        <option value="8">营销机构</option>
                        <option value="5">运营平台</option>
                    </select>
                    </div>
                </div>
                <div class="line line-dashed b-b line-lg"></div>
                <label>企业用户信息</label>
                <div class="line line-dashed b-b line-lg"></div>
                <div class="form-group">
                    <label class="col-lg-2 control-label">公司名称*</label>
                    <div class="col-lg-4">
                        <input type="text" class="form-control" name="company_name" value="{{ old('company_name') }}"
                               placeholder="请填写公司名称" data-rule-required="true" data-rule-maxLength="90">
                    </div>
                </div>
                <div class="line line-dashed b-b line-lg"></div>
                <div class="form-group">
                    <label class="col-lg-2 control-label">企业地址*</label>
                    <div class="col-lg-4">
                        <input type="text" class="form-control" name="address" value="{{ old('address') }}"
                               placeholder="请填写企业地址" data-rule-required="true" data-rule-maxLength="256">
                    </div>
                </div>
                <div class="line line-dashed b-b line-lg"></div>
                <div class="form-group">
                    <label class="col-lg-2 control-label">执照号*</label>
                    <div class="col-lg-4">
                        <input type="text" class="form-control" name="license_no" value="{{ old('license_no') }}"
                               placeholder="请填写执照号" data-rule-required="true" data-rule-maxLength="256">
                    </div>
                </div>
                <div class="line line-dashed b-b line-lg"></div>
                <div class="form-group">
                    <label class="col-lg-2 control-label">营业执照所在地*</label>
                    <div class="col-lg-4">
                        <input type="text" class="form-control" name="license_address"
                               value="{{ old('license_address') }}" placeholder="请填写营业执照所在地"
                               data-rule-required="true" data-rule-maxLength="256">
                    </div>
                </div>
                <div class="line line-dashed b-b line-lg"></div>
                <div class="form-group">
                    <label class="col-lg-2 control-label">营业执照过期日*</label>
                    <div class="col-lg-4">
                        <input type="input" class="form-control datetimepicker_mask" name="license_expire_date"
                               value="{{ old('license_expire_date') }}" placeholder="请选择营业执照过期日"
                               data-rule-required="true">
                    </div>
                </div>
                <div class="line line-dashed b-b line-lg"></div>
                <div class="form-group">
                    <label class="col-lg-2 control-label">营业范围*</label>
                    <div class="col-lg-4">
                        <input type="tel" class="form-control" name="business_scope" value="{{ old('business_scope') }}"
                               placeholder="请填写营业范围" data-rule-required="true" data-rule-maxLength="50">
                    </div>
                </div>
                <div class="line line-dashed b-b line-lg"></div>
                <div class="form-group">
                    <label class="col-lg-2 control-label">联系电话*</label>
                    <div class="col-lg-4">
                        <input type="tel" class="form-control" name="telephone" value="{{ old('telephone') }}"
                               placeholder="请填写联系电话" data-rule-required="true" data-rule-maxLength="20"
                               data-rule-remote="{{ action('Utils\UtilsController@userPhoneNumberExists') }}"
                               data-msg-remote="该手机号码已经存在"
                        >
                    </div>
                </div>
                <div class="line line-dashed b-b line-lg"></div>
                <div class="form-group">
                    <label class="col-lg-2 control-label">Email*</label>
                    <div class="col-lg-4">
                        <input type="tel" class="form-control" name="email" value="{{ old('email') }}"
                               placeholder="请填写联系电子邮箱" data-rule-required="true" data-rule-maxLength="50"
                                data-rule-remote="{{ action('Utils\UtilsController@userEmailExists') }}"
                               data-msg-remote="该邮箱已经存在"
                        >
                    </div>
                </div>
                <div class="line line-dashed b-b line-lg"></div>
                <div class= "form-group">
                    <label class="col-lg-2 control-label">组织机构代码*</label>
                    <div class="col-lg-4">
                        <input type="tel" class="form-control" name="organization_no"
                               value="{{ old('organization_no') }}" placeholder="请填写组织机构代码 如 BBLJFKJ"
                               data-rule-required="true" data-rule-maxLength="32">
                    </div>
                </div>
                <div class="line line-dashed b-b line-lg"></div>
                <div class="form-group">
                    <label class="col-lg-2 control-label">企业简介*</label>
                    <div class="col-lg-4">
                        <textarea type="tel" class="form-control" name="summary" placeholder="请填写企业简介"
                                  data-rule-required="true" data-rule-maxLength="512" style="resize: none;width: 500px;
height: 150px;">{{ old('summary') }}</textarea>
                    </div>
                </div>
                <div class="line line-dashed b-b line-lg"></div>
                <div class="form-group">
                    <label class="col-lg-2 control-label">企业法人*</label>
                    <div class="col-lg-4">
                        <input type="tel" class="form-control" name="legal_person" value="{{ old('legal_person') }}"
                               placeholder="请填写企业法人姓名" data-rule-required="true" data-rule-maxLength="50">
                    </div>
                </div>
                <div class="line line-dashed b-b line-lg"></div>
                <div class="form-group">
                    <label class="col-lg-2 control-label">证件号码*</label>
                    <div class="col-lg-4">
                        <input type="tel" class="form-control" name="cert_no" value="{{ old('cert_no') }}"
                               placeholder="请填写法人身份证号码" data-rule-id_card="true" data-rule-required="true"
                               data-rule-maxLength="18">
                    </div>
                </div>
                <div class="line line-dashed b-b line-lg"></div>
                <div class="form-group">
                    <label class="col-lg-2 control-label">法人手机号码*</label>
                    <div class="col-lg-4">
                        <input type="tel" class="form-control" name="legal_person_phone"
                               value="{{ old('legal_person_phone') }}" placeholder="请填写法人手机号码" data-rule-required="true"
                               data-rule-maxLength="20">
                    </div>
                </div>
                <div class="line line-dashed b-b line-lg"></div>
                <div class="form-group">
                    <label class="col-lg-2 control-label">银行卡号*</label>
                    <div class="col-lg-4">
                        <input type="tel" class="form-control" name="bank_account_no"
                               value="{{ old('bank_account_no') }}" placeholder="请填银行卡号" data-rule-required="true"
                               data-rule-maxLength="25">
                    </div>
                </div>
                <div class="line line-dashed b-b line-lg"></div>
                <div class="form-group">
                    <label class="col-lg-2 control-label">银行编号*</label>
                    <div class="col-lg-4">
                        <input type="tel" class="form-control" name="bank_code" value="{{ old('bank_code') }}"
                               placeholder="请填写银行编号 如 ICBC,CBC" data-rule-required="true" data-rule-maxLength="10">
                    </div>
                </div>
                <div class="line line-dashed b-b line-lg"></div>
                <div class="form-group">
                    <label class="col-lg-2 control-label">开户行省份*</label>
                    <div class="col-lg-4">
                        <input type="tel" class="form-control" name="province" value="{{ old('province') }}"
                               placeholder="请填写开户行省份" data-rule-required="true" data-rule-maxLength="128">
                    </div>
                </div>
                <div class="line line-dashed b-b line-lg"></div>
                <div class="form-group">
                    <label class="col-lg-2 control-label">开户行城市*</label>
                    <div class="col-lg-4">
                        <input type="tel" class="form-control" name="city" value="{{ old('city') }}"
                               placeholder="请填写开户行城市" data-rule-required="true" data-rule-maxLength="128">
                    </div>
                </div>
                <div class="line line-dashed b-b line-lg"></div>
                <div class="form-group">
                    <label class="col-lg-2 control-label">支行名称*</label>
                    <div class="col-lg-4">
                        <input type="tel" class="form-control" name="bank_branch" value="{{ old('bank_branch') }}"
                               placeholder="请填写支行名称" data-rule-required="true" data-rule-maxLength="255">
                    </div>
                </div>
                <div class="line line-dashed b-b line-lg"></div>
                <div class="form-group">
                    <label class="col-lg-2 control-label">企业营业执照*</label>
                    <div class="col-lg-10">
                        <input type="file" class="form-control" name="yyzz" value="{{ old('yyzz') }}"
                               data-fileinput-image>
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-lg-2 control-label">组织机构代码证*</label>
                    <div class="col-lg-10">
                        <input type="file" class="form-control" name="zzjgz" value="{{ old('zzjgz') }}"
                               data-fileinput-image>
                    </div>
                </div>
                <div class="line line-dashed b-b line-lg"></div>
                <div class="form-group">
                    <label class="col-lg-2 control-label">税务登记证*</label>
                    <div class="col-lg-10">
                        <input type="file" class="form-control" name="swdjz" value="{{ old('swdjz') }}"
                               data-fileinput-image>
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-lg-2 control-label">单位银行计算账户开户许可证*</label>
                    <div class="col-lg-10">
                        <input type="file" class="form-control" name="jsxkz" value="{{ old('jsxkz') }}"
                               data-fileinput-image>
                    </div>
                </div>
                <div class="line line-dashed b-b line-lg"></div>
                <div class="form-group">
                    <label class="col-lg-2 control-label">企业法人证件正面*</label>
                    <div class="col-lg-10">
                        <input type="file" class="form-control" name="frzjz" value="{{ old('frzjz') }}"
                               data-fileinput-image>
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-lg-2 control-label">企业法人证件反面*</label>
                    <div class="col-lg-10">
                        <input type="file" class="form-control" name="frzjf" value="{{ old('frzjf') }}"
                               data-fileinput-image>
                    </div>
                </div>

                <div class="line line-dashed b-b line-lg"></div>
                <div class="form-group">
                    <div class="col-lg-4 col-lg-offset-2">
                        <a href="{{ admin_action('Business\OrganizationalUserManagementController@index') }}"
                           class="btn btn-default">返&nbsp;回</a>
                        <button type="submit" class="btn btn-primary">保&nbsp;存</button>
                    </div>
                </div>
            </form>
        </div>
    </div>
@endsection
@section('scripts')
    @include('admin.partials.ueditor')
    <script>
        jQuery('.datetimepicker_mask').datetimepicker({
            timepicker: false,
            mask: '9999-19-39',
            format: 'Y-m-d'
        });
    </script>
@endsection